import numpy as np
import pandas as pd
import pyecharts

class ChipotleAna:

    path = 'C:/Users/Administrator/pandas_exercises-c1/01_Getting_&_Knowing_Your_Data/Chipotle/chipotle.csv'


    def __init__(self):

        #self.path = 'C:/Users/Administrator/pandas_exercises-c1/01_Getting_&_Knowing_Your_Data/Chipotle/chipotle.csv'

        self.df = pd.read_csv(self.path, sep = '\t')


    def echarts_bar(self, asix0, asix1, bar_name = 'test', name = 'test_name' ):

        bar = pyecharts.Bar(bar_name)

        bar.add(name, asix0, asix1, is_label_show=True, is_datazoom_show=True)


        return bar

        


    def how_many_are_sold_per_item(self):

        count_info = self.df.groupby('item_name').sum()

        count_info = count_info.drop('order_id', axis = 1)

        return count_info


        
